package com.creative.xcx.mapper;

import com.creative.xcx.domain.UploadHistory;
import com.creative.xcx.domain.vo.UploadHistoryVo;
import com.creative.xcx.domain.vo.UploadStatisticsVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @description 上传记录
 * @author ling
 * @date 2025-03-15
 */
@Mapper
public interface UploadHistoryMapper {

    /**
     * 新增
     * @author ling
     * @date 2025/03/15
     **/
    Integer insert(UploadHistory uploadHistory);

    /**
     * 刪除
     * @author ling
     * @date 2025/03/15
     **/
    Integer delete(Long id);
    /**
     * 批量刪除
     * @author ling
     * @date 2025/03/15
     **/

    Integer deleteBatch(  Long[]  ids);


    /**
     * 更新
     * @author ling
     * @date 2025/03/15
     **/
    Integer update(UploadHistory uploadHistory);

    /**
     * 查询 根据主键 id 查询
     * @author ling
     * @date 2025/03/15
     **/
    UploadHistory selectById(Long id);
    /**
     * 查询 分页查询(带条件)
     * @author ling
     * @date 2025/03/15
     **/
    List<UploadHistoryVo> selectUploadHistoryList(UploadHistory uploadHistory);

    /**
     * 批量导出
     * @author ling
     * @date 2025/03/15
     **/
    List<UploadHistory> exportBatch(  Long[]  ids);

    /**
     * 批量获取素材
     *
     * @param userId         用户id
     * @param materialIdList 物料id列表
     * @return {@link List }<{@link UploadHistory }>
     * @author ling
     * @date 2025/04/06
     */
    List<UploadHistoryVo> batchGetMaterials(String userId, @Param("list") List<String> materialIdList);

    List<UploadHistory> selectByUserId(String userId);

    List<UploadStatisticsVo> calculateUploadMaterial();
    /**
     * 统计上传数量
     *
     * @return {@link Long }
     * @author ling
     * @date 2025/04/28
     */
    Long calculateUploadNum();
}
